package com.lyn.tencent_health_code.entity;

import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author almost
 */
@ApiModel("请求结果")
public class RequestResult {
    @ApiModelProperty(name = "code",value = "状态码")
    private int code;
    @ApiModelProperty(name = "data",value = "数据")
    private Object data;
    @ApiModelProperty(name = "length",value = "数据长度")
    private int length;
    @ApiModelProperty(name = "message",value = "消息")
    private String message;

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

    //<editor-fold defaultstate="collapsed" desc="delombok">
    @SuppressWarnings("all")
    public RequestResult() {
    }

    @SuppressWarnings("all")
    public int getCode() {
        return this.code;
    }

    @SuppressWarnings("all")
    public Object getData() {
        return this.data;
    }

    @SuppressWarnings("all")
    public int getLength() {
        return this.length;
    }

    @SuppressWarnings("all")
    public String getMessage() {
        return this.message;
    }

    @SuppressWarnings("all")
    public void setCode(final int code) {
        this.code = code;
    }

    @SuppressWarnings("all")
    public void setData(final Object data) {
        this.data = data;
    }

    @SuppressWarnings("all")
    public void setLength(final int length) {
        this.length = length;
    }

    @SuppressWarnings("all")
    public void setMessage(final String message) {
        this.message = message;
    }

    @Override
    @SuppressWarnings("all")
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof RequestResult)) return false;
        final RequestResult other = (RequestResult) o;
        if (!other.canEqual((Object) this)) return false;
        if (this.getCode() != other.getCode()) return false;
        if (this.getLength() != other.getLength()) return false;
        final Object this$data = this.getData();
        final Object other$data = other.getData();
        if (this$data == null ? other$data != null : !this$data.equals(other$data)) return false;
        final Object this$message = this.getMessage();
        final Object other$message = other.getMessage();
        if (this$message == null ? other$message != null : !this$message.equals(other$message)) return false;
        return true;
    }

    @SuppressWarnings("all")
    protected boolean canEqual(final Object other) {
        return other instanceof RequestResult;
    }

    @Override
    @SuppressWarnings("all")
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * PRIME + this.getCode();
        result = result * PRIME + this.getLength();
        final Object $data = this.getData();
        result = result * PRIME + ($data == null ? 43 : $data.hashCode());
        final Object $message = this.getMessage();
        result = result * PRIME + ($message == null ? 43 : $message.hashCode());
        return result;
    }
    //</editor-fold>
}
